using System;

namespace SharpWars.Core.Network
{
	#region Event Handlers
	
	public delegate void StatusEventHandler( object sender, StatusEventArgs e );

	public delegate void PlayerEventHandler( object sender, PlayerEventArgs e );

	public delegate void ExceptionEventHandler( object sender, ExceptionEventArgs e );

	public delegate void MessageEventHandler( object sender, MessageEventArgs e );

	public delegate void LogEventHandler( object sender, string message );

	#endregion
	
	#region Event Arguments
	
	public class StatusEventArgs : EventArgs
	{
		private string ip = string.Empty;
		
		private int port = 0;
		
		public StatusEventArgs( string ip, int port )
		{
			this.ip   = ip;
			this.port = port;
		}
		
		public string IP
		{
			get
			{
				return this.ip;
			}
		}
		
		public int Port
		{
			get
			{
				return this.port;
			}
		}
	}
	
	public class PlayerEventArgs : EventArgs
	{
		private int playerID = 0;
		
		private string name = string.Empty;
		
		private bool ready = false;
		
		public PlayerEventArgs( int playerID, string name, bool ready )
		{
			this.playerID  = playerID;
			this.name      = name;
			this.ready     = ready;
		}
		
		public int PlayerID
		{
			get
			{
				return this.playerID;
			}
		}
		
		public string Name
		{
			get
			{
				return this.name;
			}
		}
		
		public bool Ready
		{
			get
			{
				return this.ready;
			}
		}
	}
	
	public class ExceptionEventArgs : EventArgs
	{
		private string message = string.Empty;
		
		public ExceptionEventArgs( string message )
		{
			this.message = message;
		}
		
		public string Message
		{
			get
			{
				return this.message;
			}
		}
	}
	
	public class MessageEventArgs : EventArgs
	{
		private int sender = 0;
		
		private string message = string.Empty;
		
		public MessageEventArgs( int sender, string message )
		{
			this.sender  = sender;
			this.message = message;
		}
		
		public int Sender
		{
			get
			{
				return this.sender;
			}
		}
		
		public string Message
		{
			get
			{
				return this.message;
			}
		}
	}
	
	#endregion
}